#include "softwarefind.h"
#include <stdlib.h>
int func_findname(char *name)
{
    QString sql =QString("select * from user where SoftwareName='%1'").arg(name);
    QSqlQuery query;
    bool ok = query.exec(sql);
    if(!ok)
    {
        qDebug()<<query.lastError();
    }
    if(query.next()!='\0')
    {
        return 1;
    }
    return 0;
}

QString func_findaddr(char *name)
{
    QString sql =QString("select SaveAddress from user where SoftwareName='%1'").arg(name);
    QSqlQuery query;
    bool ok = query.exec(sql);
    if(!ok)
    {
        qDebug()<<query.lastError();
    }
    query.next();
    qDebug()<<query.value(0).toString();
  //  QString Addr = query.value(0).toString();
  //  char *addr;
  //  QByteArray ba = Addr.toLatin1();
  //  addr=ba.data();
    return query.value(0).toString();
}
